package com.zufe;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class LogActivity extends Activity {
	EditText etUserName;
    EditText etUserPass;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_log);
        etUserName=(EditText)this.findViewById(R.id.etUid);
        etUserPass=(EditText)this.findViewById(R.id.etPwd);
        Button btLogin=(Button)this.findViewById(R.id.btnLogin);
        Button btReg=(Button)this.findViewById(R.id.btnReg);
        btLogin.setOnClickListener(new OnClickListener(){

		
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				String userName=etUserName.getText().toString().trim();
				String userPass=etUserPass.getText().toString().trim();
				if(userName.equals("jacky")&&userPass.equals("123"))
				{
					Intent it=new Intent(LogActivity.this,MainActivity.class);
					startActivity(it);
					
				}
			}        	
        });
        btReg.setOnClickListener(new OnClickListener(){

			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				String userName=etUserName.getText().toString().trim();
				String userPass=etUserPass.getText().toString().trim();
				if(userName.equals("jacky")&&userPass.equals("123"))
				{
					Intent it=new Intent(LogActivity.this,MainActivity.class);
					startActivity(it);
					
				}
			}        	
        });
    }
    
}
